package org.theonept.travian.model;

import java.util.Arrays;

import org.theonept.travian.t4a.R;

public enum EnumReward {
	CARRY_EMPTY("carry", "empty", R.drawable.but_no), //
	CARRY_HALF("carry", "half", R.drawable.but_half), //
	CARRY_FULL("carry", "full", R.drawable.but_full), //
	CARRY_IMPOSSIBLE("carry", "impossible", R.drawable.but_impossible), //
	ADVENTURE_HEMELT("itemCategory", "itemCategory_helmet", R.drawable.adv_hemlet), //
	ADVENTURE_BODY("itemCategory", "itemCategory_body", R.drawable.adv_body), //
	ADVENTURE_LEFT_HAND("itemCategory", "itemCategory_leftHand", R.drawable.adv_left_hand), //
	ADVENTURE_RIGHT_HAND("itemCategory", "rightHand", R.drawable.adv_right_hand), //
	ADVENTURE_SHOES("itemCategory", "itemCategory_shoes", R.drawable.adv_shoes), //
	ADVENTURE_HORSE("itemCategory", "itemCategory_horse", R.drawable.adv_horse), //
	ADVENTURE_BANDAGE_25("itemCategory", "itemCategory_bandage25", R.drawable.adv_bandage25), //
	ADVENTURE_BANDAGE_33("itemCategory", "itemCategory_bandage33", R.drawable.adv_bandage33), //
	ADVENTURE_CAGE("itemCategory", "itemCategory_cage", R.drawable.adv_cage), //
	ADVENTURE_SCROLL("itemCategory", "itemCategory_scroll", R.drawable.adv_scroll), //
	ADVENTURE_OINTMENT("itemCategory", "itemCategory_ointment", R.drawable.adv_ointment), //
	ADVENTURE_BUCKET_WATER("itemCategory", "itemCategory_bucketOfWater", R.drawable.adv_bucket_water), //
	ADVENTURE_WISDOW("itemCategory", "itemCategory_bookOfWisdom", R.drawable.adv_book_wisdom), //
	ADVENTURE_LAW_TABLES("itemCategory", "itemCategory_lawTables", R.drawable.adv_law_table), //
	ADVENTURE_ART_WORK("itemCategory", "itemCategory_artWork", R.drawable.adv_art_work);

	private String group;
	private String value;
	private Integer image;

	private EnumReward(String group, String value, Integer image) {
		this.group = group;
		this.value = value;
		this.image = image;
	}

	public static EnumReward getRewardFromCode(String code) {
		EnumReward reward = null;
		for (EnumReward rewardElement : Arrays.asList(values())) {
			if (rewardElement.getValue().equals(code)) {
				reward = rewardElement;
				break;
			}
		}
		return reward;
	}

	/**
	 * @return the group
	 */
	public String getGroup() {
		return group;
	}

	/**
	 * @param group
	 *            the group to set
	 */
	public void setGroup(String group) {
		this.group = group;
	}

	/**
	 * @return the value
	 */
	public String getValue() {
		return value;
	}

	/**
	 * @param value
	 *            the value to set
	 */
	public void setValue(String value) {
		this.value = value;
	}

	/**
	 * @return the image
	 */
	public Integer getImage() {
		return image;
	}

	/**
	 * @param image
	 *            the image to set
	 */
	public void setImage(Integer image) {
		this.image = image;
	}
}
